package com.enjoyor.soa.traffic.server.efoms.dubbo.manage;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.enjoyor.soa.traffic.api.dto.efoms.SurveyDeviceInfoDto;
import com.enjoyor.soa.traffic.core.efoms.domain.CheckDeviceInfo;
import com.enjoyor.soa.traffic.core.efoms.domain.SurveyDeviceInfo;
import com.enjoyor.soa.traffic.core.efoms.service.ISurveyDeviceInfoService;
import com.enjoyor.soa.traffic.util.helper.ReflectHelper;
import com.enjoyor.soa.traffic.util.helper.ResultHelper;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Service(timeout = 6000)
public class ManageSurveyDeviceInfoService {

	@Autowired
	private ISurveyDeviceInfoService surveyDeviceInfoService;
	
	public ResultPojo getSurveyDeviceInfoPage(String devId,String devTypeCode,String devName,String devIp,String devStatusCode,String devFactory,String devAreaCode,String devDeptId,String searchFlag,Page page){
		return ResultHelper.getResult(surveyDeviceInfoService.getSurveyDeviceInfoPage(devId, devTypeCode, devName, devIp, devStatusCode, devFactory, devAreaCode,devDeptId, searchFlag, page));
	}
	
	public ResultPojo getSurveyDeviceInfoList(String devId,String devTypeCode,String devName,String devIp,String devStatusCode,String devFactory,String devAreaCode,String devDeptId,String searchFlag){
		List<SurveyDeviceInfo> list = surveyDeviceInfoService.getSurveyDeviceInfoList(devId, devTypeCode, devName, devIp, devStatusCode, devFactory, devAreaCode,devDeptId,searchFlag);
		return ResultHelper.getResult(ReflectHelper.listToList(list, SurveyDeviceInfo.class));
	}
	
	public ResultPojo getSurveyDeviceInfo(String devId){
		SurveyDeviceInfo surveyDeviceInfo = surveyDeviceInfoService.getSurveyDeviceInfo(devId);
		return ResultHelper.getResult(ReflectHelper.beanToBean(surveyDeviceInfo, SurveyDeviceInfoDto.class));
	}
	
	public ResultPojo getSurveyCount(String devTypeCode,String beginTime,String endTime){
		ResultPojo resultPojo = surveyDeviceInfoService.getSurveyCount(devTypeCode, beginTime, endTime);
		return resultPojo;
	}
	
}
